import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css'
import VxeUIPluginValidator from '@vxe-ui/plugin-validator'
Vue.use(VxeUI)
VxeUI.setConfig({
  size: 'small'
})
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
VxeUI.use(VxeUIPluginRenderElement)
import '@vxe-ui/plugin-render-element/dist/style.css'
import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx'
import ExcelJS from 'exceljs'
VxeUI.use(VxeUIPluginExportXLSX, {
  ExcelJS
})
VxeUI.use(VxeUIPluginValidator)
Vue.prototype.VxeUI = VxeUI
Vue.use(VxeUITable)
import '@/vxe-ui-render/index'

// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)
// Vue.use(ElementUI, {
//   locale: 'zh-CN',
//   size: 'small'
// })

import YDialog from '@/components/YDialog'
Vue.component('YDialog', YDialog)
import YFormDialog from '@/components/YFormDialog'
Vue.component('YFormDialog', YFormDialog)
import YForm from '@/components/YForm'
Vue.component('YForm', YForm)
import YTable from '@/components/YTable'
Vue.component('YTable', YTable)

import YEditor from '@/components/YEditor'
Vue.component('YEditor', YEditor)

import ZSelect from '@/components/ZSelect'
Vue.component('ZSelect', ZSelect)

import ZUpload from '@/components/ZUpload'
Vue.component('ZUpload', ZUpload)
import YPopup from '@/components/YPopup'
Vue.component('YPopup', YPopup)

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// import 'tailwindcss/tailwind.css' // tailwindcss
import './tailwind.css' // global css
import * as echarts from 'echarts/core';
import { BarChart } from 'echarts/charts';
import { TitleComponent, TooltipComponent } from 'echarts/components';
import { CanvasRenderer } from 'echarts/renderers';

echarts.use([BarChart, TitleComponent, TooltipComponent, CanvasRenderer]);
Vue.prototype.FILE_BASE_URL = process.env.VUE_APP_FILE_BASE_URL

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: (h) => h(App)
})
